package com.tensquare.recruit.controller;

import com.tensquare.recruit.pojo.Recruit;
import com.tensquare.recruit.service.RecruitService;
import entity.Result;
import entity.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("recruit")
public class RecruitController {
    @Autowired
    private RecruitService recruitService;
    //1.推荐职位
    @RequestMapping("search/recommend")
    public Result recommend(){
        List<Recruit> recruitList= recruitService.recommend();
        return new Result(true, StatusCode.OK,"推荐职位查询成功",recruitList);
    }
    //2.最新职位
    @RequestMapping("search/newlist")
    public Result newlist(){
        List<Recruit> recruitList=recruitService.newlist();
        return new Result(true,StatusCode.OK,"查询最新职位成功",recruitList);
    }
}
